const fs = require('fs');
function myReadFile (filename) {
  return new Promise((resolve, reject) => {
    // 要执行的代码，写到这里
    fs.readFile(filename, 'utf-8', (err, data) => {
      err ? reject(err) : resolve(data.length)
    })
  });
}
myReadFile('./node/file/a.txt').then(res => {
  console.log(res);
})